This function will return the width of the display (in pixels). Note that on the HTML5 target, this value is the width of the browser window, rather than the physical display size.
display_get_width();
Real
mywidth = display_get_width();
This would set the variable "mywidth" to the display's width.